<?php $this->action("index","more","header");?>
        <div id="content">
            <div class="main">
      
        


                
    <h1><?php echo $mod_E->title;?>发言</h1>

                
                
                
<div class="mod">
  <div class="bd">






<form method="post" id="db-frm-discuss">
<div style="display:none;"><input type="hidden" value="1" name="update"></div>
<div id="errordiv" class="attn">
<?php echo $error;?>
</div>

<div class="item1">
  <label>标题: </label> <input type="text" value="<?php echo $forum_E->title;?>" maxlength="100" name="title" class="post-title">
</div>

<div class="item1">
  <label>内容: </label>
  <textarea cols="60" rows="30" id="text" name="text"><?php echo $forum_E->content;?></textarea>
</div>

<div class="item-submit">
 <span class="bn-flat-hot"><input type="submit" value="好了，说吧" name="submit"></span>
 <span><a id="addlink" href="javascript:void(0)">添加链接</a></span>
</div>
</form>



  </div>
</div>

<script>
Do('dialog','common', function(){
    var templ_link = '<form class="frm-addlink"><div class="item">' +
                        '<label>链接文字: </label><input name="linktext" type="text" value="SEL">' +
                        '</div>' +
                        '<div class="item">' +
                        '<label>网址: </label><input name="href" type="text" value="">' +
                        '</div><input type="submit" style="display:none;"></form>',
        addlink = function(frm, o){
            var text = $.trim(frm[0].elements['linktext'].value),
            url = $.trim(frm[0].elements['href'].value);
            if(url !== ''){
              url = /^http:\/\//.test(url)? url:"http://"+url;
              $('#text').insert_caret('[url=' + url + ']' + (text===''? url : text) + "[/url]");
              o.close();
            }
        };

    $('#addlink').click(function(e){
        e.preventDefault();
        var s = $('#text').get_sel(),
        dlg = dui.Dialog({
        content: templ_link.replace('SEL', s),
        width: 400,
        title: '添加链接',
        buttons: [{
          text: '添加',
          method: function(o){
            addlink( o.node.find('form'), o);
          }
        },'cancel']
        }).open();
        dlg.node.find('form').submit($.proxy(function(e){
            e.preventDefault();
            addlink($(e.target), this);
        }, dlg));
    });
});
</script>

            </div>
            
            <div class="aside">
                





            </div>
        
        </div>
 <?php $this->partial("/Tpl/Index/MoreAction/doFooter.htm");?>         
</body>
</html>